<%--
  Created by IntelliJ IDEA.
  User: 87070
  Date: 2022/10/17
  Time: 11:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div id="qrcode"></div>
<script type="application/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>

<script src="${pageContext.request.contextPath}/static/layui/qrcode.js"></script>
<script>

    var $=null;
    window.onload=function(){
        layui.use(['layer','jquery'],function () {
            $=layui.jquery;
        });
        //使用table生成
        // $('#qrcode').qrcode({
        //     render: "table",
        //     text: "https://www.baidu.com"
        // });

        //生成100*100(宽度100，高度100)的二维码
        $('#qrcode').qrcode({
            render: "canvas", //也可以替换为table
            width: 100,
            height: 100,
            foreground: "green",
            background: "#FFF",
            text: "http://192.168.1.7:8080/SSM_Web_exploded/fpa/index.jsp"
            // $("#output").qrcode(encodeURI("http://中文中文"));//使用encodeURI进行转码

        });

    }


    //使用canvas生成
    // $('#qrcode').qrcode({
    //     render: "canvas",
    //     text: "https://www.baidu.com"
    // });

</script>
</body>
</html>
